<?php

class Fmusic_Widget_BoxMusicActivityController extends Engine_Content_Widget_Abstract
{
  public function indexAction()
  {
    $pageTable = Engine_Api::_()->getDbtable('Pages', 'Core');
    $pageTableName = $pageTable->info('name');
    $contentTable = Engine_Api::_()->getDbtable('Content', 'Core');
    $contentTableName = $contentTable->info('name');
    $select = $pageTable->select()
    					->setIntegrityCheck(false)
    					->from($pageTableName, array())
    					->join($contentTableName, $contentTableName .'.page_id = '.$pageTableName.'.page_id', null)                    	
                    	->where($pageTableName .'.name=?', 'header')
                    	->where($contentTableName.'.name = ?', 'fphoto.box-photo-activity')
						->orWhere($contentTableName.'.name = ?', 'ialbum.box-photo-activity')
						->orWhere($contentTableName.'.name = ?', 'fvideo.box-video-activity')
                    	->limit(1);
     $row = $pageTable->fetchRow($select);
     $isLoad = 1;
     if($row)
        $isLoad = 0;
     else
     	$isLoad = 1;     	
     $this->view->isLoad = $isLoad;	    
  }
}
